From 2e95e5959ba7769b981143c4819b494cc3d3e384 Mon Sep 17 00:00:00 2001 From: "mjw@wray-m-3.hpl.hp.com" Date: Mon, 21 Jun 2004 11:55:43 +0000 Subject: [PATCH] bitkeeper revision 1.990.2.2 (40d6ccbfylHHyK831DLP8wwqRjrX4w) Documentation for xen SXP config format. --- .rootkeys | 1 + docs/xen_config.html | 192 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+) create mode 100644 docs/xen_config.html diff --git a/.rootkeys b/.rootkeys index 8d43de45d1..d4491c52f5 100644 --- a/.rootkeys +++ b/.rootkeys @@ -16,6 +16,7 @@ 3f9e7d63lTwQbp2fnx7yY93epWS-eQ docs/figs/dummy 3f9e7d564bWFB-Czjv1qdmE6o0GqNg docs/interface.tex 3f9e7d58t7N6hjjBMxSn-NMxBphchA docs/style.tex +40d6ccbfKKBq8jE0ula4eHEzBiQuDA docs/xen_config.html 3f9e7d5bz8BwYkNuwyiPVu7JJG441A docs/xenstyle.cls 3f815144d1vI2777JI-dO4wk49Iw7g extras/mini-os/Makefile 3f815144zTnCV5591ulIJQrpe5b-5Q extras/mini-os/README diff --git a/docs/xen_config.html b/docs/xen_config.html new file mode 100644 index 0000000000..0a919cc25d --- /dev/null +++ b/docs/xen_config.html @@ -0,0 +1,192 @@ + + + + + Xen Configuration Syntax + + +
+

Xen Configuration Syntax

+
+Version 0.1
2004 June 21
+
+ +

Xen Configuration

+The Xen virtual machine creation tools provide command-line interfaces and +HTTP interfaces to creating virtual machines. Underneath all these interfaces +virtual machine configuration data is represented in a common configuration syntax +called SXP. + +The SXP syntax is s-expressions (sxprs), a simple bracketed abstract syntax. +Python lists are used to represent its parsed form, with a support +api providing access to fields and values (class xenmgr.sxp). + +

SXP syntax

+

A general s-expression has the syntax: +

+s-exp = '(' s-exp* ')' | atom | string
+
+Where an atom is an unquoted string, such as fred or /domain/0. +A string is a quoted string, supporting the usual escape sequences. +Strings support single or double quotes: 'fred 1' or "fred 2" are both accepted. +The characters ()[]<>{} are separators. + +

An element is an s-expression representing data similar to XML. +It has the form: +

+element    = '(' name attributes? value* ')'
+name       = atom
+attributes = '(' '@' attribute* ')'
+attribute  = '(' attrname attrval ')'
+attrname   = atom
+attrval    = atom | string
+value      = element | atom | string
+
+The name is the element name (roughly indentifying its type). +The attributes is a list of attribute-values. +We usually prefer to avoid using attributes, and use sub-elements instead. +As in XML, any element may have the attribute id to give it an identifier +for later reference. + +

VM configuration

+A vm configuration is a single SXP vm element, with subelements for +vm parameters and devices. The supported elements and their fields +are listed below. + +

(vm) element

+The top-level element, a virtual machine configuration. + + +

(image (linux)) element

+Defines a linux kernel image and its command-line parameters. + + +

(image (netbsd)) element

+Defines a netbsd kernel image and its command-line parameters. + + +

(controller (block)) element

+Define that the vm is a block device controller backend. +The vm can have pci devices configured, but no virtual +block devices. + +

(controller (net)) element

+Define that the vm is a net device controller backend. +The domain may not have virtual network interfaces (vifs) configured. + +

(device (vif)) element

+Defines a virtual network interface. + +A random MAC is assined is not specified. +The interface is connected to the system default bridge if no bridge +is specified. + +

(device (vbd)) element

+Defines a virtual block device. + +The uname field defines the device being exported from the block device +controller. The dev field defines the device name the vm will see. +The device is read-only unless the mode contains w. + +

(device (pci)) element

+Defines a pci device. + +The bus, dev or func may be given in hex, +e.g. 0xff. With no leading 0x they are interpreted as decimal. + +

(vnet) element

+Defines the virtual networks associated with vifs (may go away soon). +Contains a list of vif elements: + + +

(vfr) element

+Defines the ip addresses for vifs (may go away soon). +Contains a list of vif elements: + + +

Examples

+

A vm with 64 MB memory, root on /dev/xda1 (mapped from /dev/hda1), +one vif with default MAC. +

+(vm
+    (name xendom1)
+    (memory 64)
+    (image
+        (linux
+            (kernel /boot/vmlinuz-2.4.26-xen)
+            (ip ::::xendom1:eth0:dhcp)
+            (root /dev/xda1)
+            (args 'rw fastboot 4')
+        )
+    )
+    (device (vif))
+    (device (vbd (uname phy:hda1) (dev xda1) (mode w)))
+)
+
+ +

A vm with 64 MB memory, NFS root, and 2 vifs on separate vnets. +

+(vm 
+   (name xendom2)
+   (memory 64)
+    # Define a linux image.
+    (image
+        (linux 
+            (kernel "/boot/vmlinuz-2.4.26-xen")
+            (ip     "::::xendom2:eth0:dhcp")
+            (root   "/dev/nfs")
+            (args   "rw fastboot nfsroot=15.144.25.79:/opt/xen/xendom2 4")
+         )
+    )
+    # Define some vifs, with ids for use later.
+    (device (vif (@ (id vif1)) (mac aa:00:00:00:00:12)))
+    (device (vif (@ (id vif2)) (mac aa:00:00:00:10:12)))
+
+     # Configure vnets. Refer to vifs by id.
+     (vnet (vif (id vif1) (vnet 1))
+           (vif (id vif2) (vnet 2)))
+
+)
+
+ + + -- 2.30.2